<template>
  <div>
    <van-nav-bar title="提交订单" :fixed="true" left-arrow @click-left="onClickLeft" />

    <van-cell class="van-cell" icon="location" is-link>
      <div class="van-cell-addr">
        <div class="van-address-item__name">shanshan，130000000000</div>
        <div class="van-address-item__address">浙江省杭州市西湖区文三路 138 号东方通信大厦 7 楼 501 室</div>
      </div>
    </van-cell>
    <van-submit-bar :price="price*100" button-text="提交订单" @submit="onSubmit" />
  </div>
</template>

<script>
import { mapState, mapGetters } from "vuex";
import VueEvent from "../router/index";
export default {
  name: "submit",
  data() {
    return {
      total: ""
    };
  },
  methods: {
    onClickLeft() {
      this.$router.go(-1);
    },
    onSubmit() {
      console.log("12");
    }
    // ...mapMutations(['onSubmit'])
  },
  mounted() {
    //   接收兄弟组件cart传来的总价

    this.$on("tp", data => {
      console.log("12");
      console.log(data);
      this.total = data;
    });
  },

  computed: {
    // ...mapState(['TotalPrice']),
    ...mapGetters(["price"])
  }
};
</script>

<style scoped>
.van-cell {
  padding: 16px;
  position: relative;
  color: #323233;
  font-size: 14px;
  line-height: 24px;
  background-color: #fff;
}
.van-address-item__name {
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
}
.van-address-item__address {
    color: #7d7e80;
    font-size: 12px;
    line-height: 16px;
}
.van-cell-addr{
  margin-left: 10px;
}

</style>